import java.sql.*;

public class MainTest {
	public static void main(String[] args) {
		System.out.println("hello");
		String sql = "select * from student";
		try {
			DBHelper dbHelper = new DBHelper(sql);
			ResultSet resultSet = dbHelper.pst.executeQuery(); //开始执行sql语句
			while (resultSet.next()) {
				String name = resultSet.getString("name");
				String age = resultSet.getString("age");
				System.out.println("name:"+name+"   age:"+age);
			}
			//关闭数据库
			resultSet.close();
			dbHelper.close();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
		
		
		
	}
}
